-module(interpreter).
-compile(export_all).

-define(RUNHERTZ_PATH, "../../lang.testing/runhertz").
-define(TMP_DIR, "tmp/").

runhertz(Arg) ->
    {A, B, C} = now(),
    Filename = ?TMP_DIR ++ integer_to_list(A) ++ integer_to_list(B) ++ integer_to_list(C) ++ integer_to_list(random:uniform(C)) ++ ".hz",
    file:write_file(Filename, Arg),
    
    Output = os:cmd(?RUNHERTZ_PATH ++ " " ++ Filename),
    os:cmd("rm " ++ Filename),
    Output.

